import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
// import Immutable from 'immutable'
// import pureRender from "pure-render-decorator"

import MenuUl from './MenuUl'
import { fetchChannels } from "../actions"

import './menu.less'


@connect((state)=>({
  channels: state.get('channels').get('datas'),
  isFetching: state.get('channels').get('isChannelsFetching')
}))

export default class Menu extends Component {
	constructor(props) {
    super(props)
  }

  componentDidMount() {
    const {dispatch} = this.props
    dispatch(fetchChannels())
  }

  render() {
    return (
      <div className="menu menu-style">
        <MenuUl channels={this.props.channels}/>
      </div>
    );
  }
}
